package com.example.it;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.it.adapter.Adpater;
import com.example.it.bean.DataBean;

import java.util.ArrayList;

public class Main2Activity extends AppCompatActivity {

    private Toolbar mBar2;
    private RecyclerView mRe;
    private ImageView mIamge2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        initViews();
    }

    private void initViews() {
        mBar2 = findViewById(R.id.bar2);
        mRe = findViewById(R.id.re);
        mIamge2 = findViewById(R.id.iamge2);
        mRe.setLayoutManager(new LinearLayoutManager(this));
        mRe.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
        ArrayList<DataBean> data =(ArrayList<DataBean>) getIntent().getSerializableExtra("data");
        Adpater adpater = new Adpater(this, data);
        mRe.setAdapter(adpater);
        mIamge2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });
    }
}
